#region Using directives

using System;
using System.Collections.Generic;
using System.Text;

#endregion

namespace Weazel.Gezel.Simulator.Reference
{
  /// <summary>
  /// Encapsulates a simple string to be
  /// shown from a $display directive
  /// </summary>
  class StringDisplay : AbstractDisplay
  {
    /// <summary>
    /// String to display
    /// </summary>
    private readonly string s;

    /// <summary>
    /// Intializes the StringDisplay with
    /// the string to be shown when the 
    /// $display directive is run
    /// </summary>
    /// <param name="str"></param>
    public StringDisplay(string str)
    {
      this.s = str;
    }

    /// <summary>
    /// Just append the string to the
    /// output buffer
    /// </summary>
    /// <param name="g">simulation cycle</param>
    /// <param name="buffer">output buffer</param>
    public override void Show(long g, StringBuilder buffer)
    {
      buffer.Append(s);
    }
  }
}
